<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Untitled Document</title>
        <link rel="stylesheet" type="text/css" href="../lib/resources/css/ext-all.css"/>
        <script type="text/javascript" src="../lib/js/ext-base-debug.js">
        </script>
        <!-- ENDLIBS -->
        <script type="text/javascript" src="../lib/js/ext-all-debug.js">
        </script>
        <script type="text/javascript" src="TreeNodeCheck.js">
        </script>
    </head>
    <body>

        <script type="text/javascript">
            Ext.onReady(function(){
                var mytree = new Ext.tree.TreePanel({
                    region: 'west',
                    width: 200,
                    title: '角色列表',
                    autoScroll: true,
					enableAllCheck:true,
                    loader: new Ext.tree.TreeLoader(),
                    rootVisible: false,
                    root: new Ext.tree.AsyncTreeNode({
                        expanded: true,
                        children: [{
                            text: '系统管理员',
                            children: [{
                                text: '系统管理员',
                                children: [{
                                    text: '系统管理员',
                                    leaf: true
                                }, {
                                    text: '系统管理员',
                                    leaf: true
                                }, {
                                    text: '系统管理员',
                                    leaf: true
                                }]
                            }, {
                                text: '系统管理员'
                            }, {
                                text: '系统管理员'
                            }]
                        }, {
                            text: '煤炭局局长'
                        }, {
                            text: '煤炭局副局长'
                        }, {
                            text: '煤炭局监控员'
                        }, {
                            text: '矿山管理员'
                        }]
                    }),
                    tbar: {
                        items: [{
                            text: 'click me',
                            handler: function(){
                                alert(mytree.getChecked('id').join(','));
                            }
                        }]
                    }
                });
                
                
                var viewport = new Ext.Viewport({
                    layout: 'border',
                    items: [mytree, {
                        region: 'center'
                    }]
                });
            });
        </script>
    </body>
</html>
